import request from '@/utils/request'

export function pre(data) {
  return request({
    url: '/pre',
    method: 'post',
    params: data
  })
}

export function one(data) {
  return request({
    url: '/one',
    method: 'post',
    params: data
  })
}

export function pre2(data) {
  return request({
    url: '/pre2',
    method: 'post',
    params: data
  })
}

export function uploadTemperatureExcel(data) {
  return request({
    url: '/uploadTemperatureExcel',
    method: 'post',
    data: data
  })
}

export function uploadCurrentExcel(data) {
  return request({
    url: '/uploadCurrentExcel',
    method: 'post',
    data: data
  })
}

export function trainModel(trainParam) {
  return request({
    url: '/trainModel',
    method: 'post',
    data: trainParam
  })
}

export function predictModel(usingModel) {
  return request({
    url: '/predictModel',
    method: 'get',
    params: { usingModel }
  })
}

export function getAvailableModel() {
  return request({
    url: '/availableModel',
    method: 'get'
  })
}

export function getDeviceNumbers() {
  return request({
    url: '/deviceNumber',
    method: 'get'
  })
}

export function getDeviceNames() {
  return request({
    url: '/deviceName',
    method: 'get'
  })
}

export function getCount() {
  return request({
    url: '/v2/count',
    method: 'get'
  })
}

export function getCurrentCompare() {
  return request({
    url: '/v2/getCurrentCompare',
    method: 'get'
  })
}

export function getPearsonParam() {
  return request({
    url: '/v2/getPearsonParam',
    method: 'get'
  })
}

export function getTemperatureTop() {
  return request({
    url: '/v2/getTemperatureTop',
    method: 'get'
  })
}

export function getTodayTemperature() {
  return request({
    url: '/v2/getTodayTemperature',
    method: 'get'
  })
}

export function previewCurrentTable() {
  return request({
    url: '/v2/previewCurrentTable',
    method: 'get'
  })
}

export function previewEnvironmentTable() {
  return request({
    url: '/v2/previewEnvironmentTable',
    method: 'get'
  })
}

export function totalData() {
  return request({
    url: '/v2/count',
    method: 'get'
  })
}
